﻿CREATE PROCEDURE [dbo].[EditorInsert]
	@UserName nVarChar(50),
	@FirstName nVarChar(50),
	@LastName nVarChar(50),
	@EmailAddress nVarChar(254),
	@PasswordSalt varChar(max),
	@PasswordHash varChar(max)
AS
	SET NOCOUNT ON

	INSERT INTO Editor (
		UserName,
		FirstName, 
		LastName, 
		EmailAddress,
		PasswordSalt,
		PasswordHash)
	VALUES (
		@UserName,
		@FirstName, 
		@LastName, 
		@EmailAddress,
		@PasswordSalt,
		@PasswordHash)

	DECLARE @EditorKey int = scope_identity()

	EXEC dbo.EditorSelectModel @EditorKey = @EditorKey, @Audit_UserKey = 0

RETURN 0


	

